var url ='ws://47.103.21.65:5645/socket/'

function connect(){
  let token =wx.getStorageSync('token')
wx.connectSocket({
  url: url+token,
  header:{
    'content-type':'application/json'
  },
  success:function(){
      console.log("succeesw")
  },
  fail:function(){
    console.log("fail")
  }
})
wx.onSocketOpen(function(res){
  wx.showToast({
    title: 'open',
  })
})
wx.onSocketError(function(res){
  wx.showToast({
    title: 'fail',
  })
})



}

module.exports={
  connect:connect
}